|
|
|
|
|
|
|
strMsg = strMsg & ShowType(objItem.Type) & "}"
strMsg = strMsg & vbCrLf
Next
'
MsgBox strMsg, vbInformation, "DBEngine"
Exit Sub
'
LocalErr:
strMsg = strMsg & "<err>"
Resume Next
End Sub |
|
|
|
|
|
|
|
|
In Listing 9.2, you first tell Visual Basic to ignore any errors it might receive while enumerating the DBEngine properties. Then you declare an object variable to hold the properties of the DBEngine object and a string variable to hold the constructed display message. You then use the Visual Basic 5 For..Each loop to list each of the properties of the DBEngine object and build a display message string. |
|
|
|
|
|
|
|
|
Save the form as FRMMSJET.FRM and the project as PRJMSJET.VBP. When you run the project, you see a single button at the bottom of the form. Click that button to force Visual Basic to enumerate the properties of the DBEngine data-access object. Your screen should look like Figure 9.2. |
|
|
|
|
|
|
|
|
Figure 9.2.
The enumerated
DBEngine properties. |
|
|
|
|
|
|
|
|
Setting the DBEngine Properties |
|
|
|
|
|
|
|
|
You can set the properties of the DBEngine object in your program, too. For example, you can use the IniPath property to point to a special ISAM driver needed to process the related database: |
|
|
|
|
|
|
|
|
DBEngine.IniPath = _"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Jet\3.5\
ISAM Formats\FoxPro 3.0" |
|
|
|
|
| |
|
|
|
|
In Microsoft Jet 2.5, the IniPath property actually points to an INI file in the <WINDOWS> folder on the workstation. In Microsoft Jet 3.0 and 3.5, the IniPath property is used to point to a location in the workstation's System Registry. |
|
|
|
|
|
|
|